package com.smart.model.convert;

import com.smart.model.dtomapper.DictItemDtoMapper;
import com.smart.model.domain.DictItemDO;
import com.smart.model.vo.DictItemVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DictItemConvert {

    public static List<DictItemVO> buildDictItemVoList(List<DictItemDO> dictItemDOList) {
        if (CollectionUtils.isEmpty(dictItemDOList)) {
            return Lists.newArrayList();
        }
        List<DictItemVO> dictItemVOList = new ArrayList<>();
        for (DictItemDO dictItemDO : dictItemDOList) {
            dictItemVOList.add(DictItemDtoMapper.INSTANCE.do2VO(dictItemDO));
        }

        return dictItemVOList;
    }
}
